<template>
  <div class="groip-container">
  <transition   name="component-fade" mode="out-in" >
    <router-view @list="getlist"></router-view>
  </transition>
  </div>
</template>
<script>
export default {
  name: '',
  components: {},
  props: {},
  data () {
    return {
      listId: ''
    }
  },
  created () {
    const hashLocation = sessionStorage.getItem("hashLocation");// 缓存中获取当前页面的路由名称
    const newLocation = hashLocation.split("#/")[1];
    // 注意, 这里使用全路径匹配,在hash模式中,因为地址会携带#,所以页面报告中的url需要重新覆盖一下, 将#去除
    this.$matomo.setCustomUrl("http://39.105.118.190" + "/" + newLocation);// 覆盖页面报告的url，可以自定义页面url，加上本页面路由
    // this.$matomo.trackEvent.addListener(document.getElementsByClassName('el-button')) // 事件
    this.$matomo.trackPageView(hashLocation);// 页面名称,可以自定义页面名称
  },
  methods: {
    getlist (val) {
      this.listId = val
    }
  }
}
</script>

<style lang="less" scoped>
.groip-container{
  margin-top: 10px;
}
// 实现页面淡入淡出
.component-fade-enter-active, .component-fade-leave-active {
  transition: opacity .4s ease;
}
.component-fade-enter, .component-fade-leave-to
/* .component-fade-leave-active for below version 2.1.8 */ {
  opacity: 0;
}
</style>
